package demo.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import static org.springframework.web.bind.annotation.RequestMethod.GET;

@FeignClient(name="HelloServer",fallback = HelloClientFallback.class)
public interface HelloClient {
    @RequestMapping(value = "/hello", method = GET)
    String hello();


    static class HelloClientFallback implements HelloClient {
        @Override
        public String hello() {
            return "fallback";
        }
    }
}
